
export function parseOpenTime(startDateTime, endDateTime) {
  const startTime = startDateTime.toLocaleTimeString()
  const endTime = endDateTime.toLocaleTimeString()

  const openTime = startTime + '-' + endTime

  return openTime
}

export function formatOpenTime(openTime) {
  console.log(openTime)
  const openTimeArray = openTime.split('-')
  const startDate = Time2Date(openTimeArray[0])
  const endDate = Time2Date(openTimeArray[1])

  console.log(openTimeArray)

  return [startDate, endDate]
}

export function Time2Date(timeStr) {
  const timeArray = timeStr.split(':')

  return new Date(1970, 1, 1, timeArray[0], timeArray[1], timeArray[2])
}

